package demo1;

import java.util.Arrays;

//求出1-100的和
public class test4 {
        public static void main(String[] args) {
            System.out.println("求和="+isSum());
        }

/*
    返回值类型：int
    方法名称：isSum
    参数列表：sum
 */

        public static  int isSum(){
            int sum = 0;
            for (int i = 1; i <= 100; i++) {
                //sum = sum + i;
                sum += i;
            }
            return sum;
        }


}
